package com.nyist.entities;

/**
 * @author yangxiaogen
 * @date 2021/3/1 11:26
 */
public class SpringSingleton {

    private volatile static SpringSingleton singleton;

    private SpringSingleton() {
    }

    public static SpringSingleton getSingleton() {
        if (singleton == null) {
            synchronized (SpringSingleton.class) {
                if (singleton == null) {
                    singleton = new SpringSingleton();
                }
            }
        }
        return singleton;
    }
}
